Skip to content

gh-133403: Add type annotations to generate_levenshtein_examples.py#143317

Open
sandole wants to merge 4 commits intopython:mainfrom
sandole:add-typing-generate-levenshtein
Open

gh-133403: Add type annotations to generate_levenshtein_examples.py#143317
sandole wants to merge 4 commits intopython:mainfrom
sandole:add-typing-generate-levenshtein

Conversation

@sandole
Copy link

@sandole sandole commented Dec 31, 2025

Summary

  • Added type annotations to Tools/build/generate_levenshtein_examples.py
  • Updated Tools/build/mypy.ini to include the file for strict type checking
  • Updated .github/workflows/mypy.yml to check the file in CI

Type annotations added

  • Function parameters and return types for _substitution_cost, levenshtein, and main
  • Variable type annotation for the examples set
  • Added from __future__ import annotations for cleaner syntax

Test plan

  • Ran mypy --config-file=Tools/build/mypy.ini Tools/build/generate_levenshtein_examples.py
  • All mypy strict checks pass with no issues

This continues the ongoing effort in #133403 to add type checking to more build tools.


📚 Documentation preview 📚: https://cpython-previews--143317.org.readthedocs.build/

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review pending The issue will be closed if no feedback is provided skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants